/**
 * 
 */
package com.lorizz.picpub.web.controller;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.lorizz.upm.np.UserProfileNP;

/**
 * @author wind hong
 * 
 */
@Controller
public interface UserProfileController {

	@RequestMapping(value = "/signin", method = RequestMethod.GET)
	String signIn(Model model);

	@RequestMapping(value = "/signup", method = RequestMethod.GET)
	String signUp(Model model);

	@Transactional(readOnly = true)
	@RequestMapping(value = "/signin", method = RequestMethod.POST)
	String signIn(@RequestParam("name") String name, @RequestParam("password") String pincode,
			@RequestParam(value = "remember", required = false) String remember,
			@RequestParam(value = "path", required = false) String path, HttpSession session,
			HttpServletResponse response, Model model);

	@Transactional
	@RequestMapping(value = "/signup", method = RequestMethod.POST)
	String signUp(@ModelAttribute("userProfile") UserProfileNP userProfileNP, BindingResult result,
			HttpSession session, Model model);

	@RequestMapping(value = "/logout", method = RequestMethod.GET)
	String logout(HttpSession session, HttpServletResponse response, Model model);
}
